home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / Dialogs.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  10.8 KB  |  533 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Dialogs.a
  3. ;
  4. ;    Contains:    Dialog Manager interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  21. __DIALOGS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  25.     include 'Errors.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  30.     include 'Memory.a'
  31.     ENDIF
  32. ;        include 'Types.a'                                            ;
  33. ;        include 'MixedMode.a'                                        ;
  34.  
  35.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  36.     include 'Windows.a'
  37.     ENDIF
  38. ;        include 'Quickdraw.a'                                        ;
  39. ;            include 'QuickdrawText.a'                                ;
  40. ;        include 'Events.a'                                            ;
  41. ;            include 'OSUtils.a'                                    ;
  42. ;        include 'Controls.a'                                        ;
  43. ;            include 'Menus.a'                                        ;
  44.  
  45.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  46.     include 'TextEdit.a'
  47.     ENDIF
  48.  
  49.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  50.     include 'Events.a'
  51.     ENDIF
  52.  
  53. ctrlItem                        EQU        4
  54. btnCtrl                            EQU        0
  55. chkCtrl                            EQU        1
  56. radCtrl                            EQU        2
  57. resCtrl                            EQU        3
  58. statText                        EQU        8
  59. editText                        EQU        16
  60. iconItem                        EQU        32
  61. picItem                            EQU        64
  62. userItem                        EQU        0
  63. itemDisable                        EQU        128
  64. ok                                EQU        1
  65. cancel                            EQU        2
  66. stopIcon                        EQU        0
  67. noteIcon                        EQU        1
  68. cautionIcon                        EQU        2
  69.  
  70. ; typedef short             DITLMethod
  71.  
  72. overlayDITL                        EQU        0
  73. appendDITLRight                    EQU        1
  74. appendDITLBottom                EQU        2
  75.  
  76. ; typedef short             StageList
  77. ; typedef OSType             DialogPropertyTag
  78.     IF STRICT_WINDOWS  THEN
  79.     ELSE
  80. ; typedef WindowPtr         DialogPtr
  81. ; typedef DialogPtr         DialogRef
  82.     ENDIF
  83.     IF ¬ STRICT_WINDOWS  THEN
  84. DialogRecord             RECORD    0
  85. window                     ds     WindowRecord ; offset: $0 (0)
  86. items                     ds.l   1        ; offset: $9C (156)
  87. textH                     ds.l   1        ; offset: $A0 (160)
  88. editField                 ds.w   1        ; offset: $A4 (164)
  89. editOpen                 ds.w   1        ; offset: $A6 (166)
  90. aDefItem                 ds.w   1        ; offset: $A8 (168)
  91. sizeof                     EQU *            ; size:   $AA (170)
  92.                         ENDR
  93.  
  94. ; typedef struct DialogRecord  DialogRecord
  95. ; typedef DialogRecord         *DialogPeek
  96.     ENDIF
  97. DialogTemplate             RECORD    0
  98. boundsRect                 ds     Rect    ; offset: $0 (0)
  99. procID                     ds.w   1        ; offset: $8 (8)
  100. visible                     ds.b   1        ; offset: $A (10)
  101. filler1                     ds.b   1        ; offset: $B (11)
  102. goAwayFlag                 ds.b   1        ; offset: $C (12)
  103. filler2                     ds.b   1        ; offset: $D (13)
  104. refCon                     ds.l   1        ; offset: $E (14)
  105. itemsID                     ds.w   1        ; offset: $12 (18)
  106. title                     ds.l   64        ; offset: $14 (20)
  107. sizeof                     EQU *            ; size:   $114 (276)
  108.                         ENDR
  109.  
  110. ; typedef struct DialogTemplate  DialogTemplate
  111. ; typedef DialogTemplate     *DialogTPtr, **DialogTHndl
  112. AlertTemplate             RECORD    0
  113. boundsRect                 ds     Rect    ; offset: $0 (0)
  114. itemsID                     ds.w   1        ; offset: $8 (8)
  115. stages                     ds.w   1        ; offset: $A (10)
  116. sizeof                     EQU *            ; size:   $C (12)
  117.                         ENDR
  118.  
  119. ; typedef struct AlertTemplate  AlertTemplate
  120. ; typedef AlertTemplate     *AlertTPtr, **AlertTHndl
  121. ;
  122. ; pascal void InitDialogs(void *ignored)
  123. ;
  124.     IF ¬ GENERATINGCFM THEN
  125.         _InitDialogs:    OPWORD    $A97B
  126.     ELSE
  127.         IMPORT_CFM_FUNCTION    InitDialogs
  128.     ENDIF
  129.  
  130. ;
  131. ; pascal void ErrorSound(SoundUPP soundProc)
  132. ;
  133.     IF ¬ GENERATINGCFM THEN
  134.         _ErrorSound:    OPWORD    $A98C
  135.     ELSE
  136.         IMPORT_CFM_FUNCTION    ErrorSound
  137.     ENDIF
  138.  
  139. ;
  140. ; pascal DialogRef NewDialog(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowRef behind, Boolean goAwayFlag, long refCon, Handle itmLstHndl)
  141. ;
  142.     IF ¬ GENERATINGCFM THEN
  143.         _NewDialog:    OPWORD    $A97D
  144.     ELSE
  145.         IMPORT_CFM_FUNCTION    NewDialog
  146.     ENDIF
  147.  
  148. ;
  149. ; pascal DialogRef GetNewDialog(short dialogID, void *dStorage, WindowRef behind)
  150. ;
  151.     IF ¬ GENERATINGCFM THEN
  152.         _GetNewDialog:    OPWORD    $A97C
  153.     ELSE
  154.         IMPORT_CFM_FUNCTION    GetNewDialog
  155.     ENDIF
  156.  
  157. ;
  158. ; pascal void CloseDialog(DialogRef theDialog)
  159. ;
  160.     IF ¬ GENERATINGCFM THEN
  161.         _CloseDialog:    OPWORD    $A982
  162.     ELSE
  163.         IMPORT_CFM_FUNCTION    CloseDialog
  164.     ENDIF
  165.  
  166. ;
  167. ; pascal void DisposeDialog(DialogRef theDialog)
  168. ;
  169.     IF ¬ GENERATINGCFM THEN
  170.         _DisposeDialog:    OPWORD    $A983
  171.     ELSE
  172.         IMPORT_CFM_FUNCTION    DisposeDialog
  173.     ENDIF
  174.  
  175. ;
  176. ; pascal void ParamText(ConstStr255Param param0, ConstStr255Param param1, ConstStr255Param param2, ConstStr255Param param3)
  177. ;
  178.     IF ¬ GENERATINGCFM THEN
  179.         _ParamText:    OPWORD    $A98B
  180.     ELSE
  181.         IMPORT_CFM_FUNCTION    ParamText
  182.     ENDIF
  183.  
  184. ;
  185. ; pascal void ModalDialog(ModalFilterUPP modalFilter, short *itemHit)
  186. ;
  187.     IF ¬ GENERATINGCFM THEN
  188.         _ModalDialog:    OPWORD    $A991
  189.     ELSE
  190.         IMPORT_CFM_FUNCTION    ModalDialog
  191.     ENDIF
  192.  
  193. ;
  194. ; pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  195. ;
  196.     IF ¬ GENERATINGCFM THEN
  197.         _IsDialogEvent:    OPWORD    $A97F
  198.     ELSE
  199.         IMPORT_CFM_FUNCTION    IsDialogEvent
  200.     ENDIF
  201.  
  202. ;
  203. ; pascal Boolean DialogSelect(const EventRecord *theEvent, DialogRef *theDialog, short *itemHit)
  204. ;
  205.     IF ¬ GENERATINGCFM THEN
  206.         _DialogSelect:    OPWORD    $A980
  207.     ELSE
  208.         IMPORT_CFM_FUNCTION    DialogSelect
  209.     ENDIF
  210.  
  211. ;
  212. ; pascal void DrawDialog(DialogRef theDialog)
  213. ;
  214.     IF ¬ GENERATINGCFM THEN
  215.         _DrawDialog:    OPWORD    $A981
  216.     ELSE
  217.         IMPORT_CFM_FUNCTION    DrawDialog
  218.     ENDIF
  219.  
  220. ;
  221. ; pascal void UpdateDialog(DialogRef theDialog, RgnHandle updateRgn)
  222. ;
  223.     IF ¬ GENERATINGCFM THEN
  224.         _UpdateDialog:    OPWORD    $A978
  225.     ELSE
  226.         IMPORT_CFM_FUNCTION    UpdateDialog
  227.     ENDIF
  228.  
  229. ;
  230. ; pascal short Alert(short alertID, ModalFilterUPP modalFilter)
  231. ;
  232.     IF ¬ GENERATINGCFM THEN
  233.         _Alert:    OPWORD    $A985
  234.     ELSE
  235.         IMPORT_CFM_FUNCTION    Alert
  236.     ENDIF
  237.  
  238. ;
  239. ; pascal short StopAlert(short alertID, ModalFilterUPP modalFilter)
  240. ;
  241.     IF ¬ GENERATINGCFM THEN
  242.         _StopAlert:    OPWORD    $A986
  243.     ELSE
  244.         IMPORT_CFM_FUNCTION    StopAlert
  245.     ENDIF
  246.  
  247. ;
  248. ; pascal short NoteAlert(short alertID, ModalFilterUPP modalFilter)
  249. ;
  250.     IF ¬ GENERATINGCFM THEN
  251.         _NoteAlert:    OPWORD    $A987
  252.     ELSE
  253.         IMPORT_CFM_FUNCTION    NoteAlert
  254.     ENDIF
  255.  
  256. ;
  257. ; pascal short CautionAlert(short alertID, ModalFilterUPP modalFilter)
  258. ;
  259.     IF ¬ GENERATINGCFM THEN
  260.         _CautionAlert:    OPWORD    $A988
  261.     ELSE
  262.         IMPORT_CFM_FUNCTION    CautionAlert
  263.     ENDIF
  264.  
  265. ;
  266. ; pascal void GetDialogItem(DialogRef theDialog, short itemNo, short *itemType, Handle *item, Rect *box)
  267. ;
  268.     IF ¬ GENERATINGCFM THEN
  269.         _GetDialogItem:    OPWORD    $A98D
  270.     ELSE
  271.         IMPORT_CFM_FUNCTION    GetDialogItem
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal void SetDialogItem(DialogRef theDialog, short itemNo, short itemType, Handle item, const Rect *box)
  276. ;
  277.     IF ¬ GENERATINGCFM THEN
  278.         _SetDialogItem:    OPWORD    $A98E
  279.     ELSE
  280.         IMPORT_CFM_FUNCTION    SetDialogItem
  281.     ENDIF
  282.  
  283. ;
  284. ; pascal void HideDialogItem(DialogRef theDialog, short itemNo)
  285. ;
  286.     IF ¬ GENERATINGCFM THEN
  287.         _HideDialogItem:    OPWORD    $A827
  288.     ELSE
  289.         IMPORT_CFM_FUNCTION    HideDialogItem
  290.     ENDIF
  291.  
  292. ;
  293. ; pascal void ShowDialogItem(DialogRef theDialog, short itemNo)
  294. ;
  295.     IF ¬ GENERATINGCFM THEN
  296.         _ShowDialogItem:    OPWORD    $A828
  297.     ELSE
  298.         IMPORT_CFM_FUNCTION    ShowDialogItem
  299.     ENDIF
  300.  
  301. ;
  302. ; pascal void SelectDialogItemText(DialogRef theDialog, short itemNo, short strtSel, short endSel)
  303. ;
  304.     IF ¬ GENERATINGCFM THEN
  305.         _SelectDialogItemText:    OPWORD    $A97E
  306.     ELSE
  307.         IMPORT_CFM_FUNCTION    SelectDialogItemText
  308.     ENDIF
  309.  
  310. ;
  311. ; pascal void GetDialogItemText(Handle item, Str255 text)
  312. ;
  313.     IF ¬ GENERATINGCFM THEN
  314.         _GetDialogItemText:    OPWORD    $A990
  315.     ELSE
  316.         IMPORT_CFM_FUNCTION    GetDialogItemText
  317.     ENDIF
  318.  
  319. ;
  320. ; pascal void SetDialogItemText(Handle item, ConstStr255Param text)
  321. ;
  322.     IF ¬ GENERATINGCFM THEN
  323.         _SetDialogItemText:    OPWORD    $A98F
  324.     ELSE
  325.         IMPORT_CFM_FUNCTION    SetDialogItemText
  326.     ENDIF
  327.  
  328. ;
  329. ; pascal short FindDialogItem(DialogRef theDialog, Point thePt)
  330. ;
  331.     IF ¬ GENERATINGCFM THEN
  332.         _FindDialogItem:    OPWORD    $A984
  333.     ELSE
  334.         IMPORT_CFM_FUNCTION    FindDialogItem
  335.     ENDIF
  336.  
  337. ;
  338. ; pascal DialogRef NewColorDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowRef behind, Boolean goAwayFlag, long refCon, Handle items)
  339. ;
  340.     IF ¬ GENERATINGCFM THEN
  341.         _NewColorDialog:    OPWORD    $AA4B
  342.     ELSE
  343.         IMPORT_CFM_FUNCTION    NewColorDialog
  344.     ENDIF
  345.  
  346. ;
  347. ; pascal short GetAlertStage(void)
  348. ;
  349.     IF ¬ GENERATINGCFM THEN
  350.         Macro
  351.         GetAlertStage        &dest=(sp)
  352.         move.w               $0A9A,&dest
  353.         EndM
  354.     ELSE
  355.         IMPORT_CFM_FUNCTION    GetAlertStage
  356.     ENDIF
  357.  
  358. ;
  359. ; pascal void ResetAlertStage(void)
  360. ;
  361.     IF ¬ GENERATINGCFM THEN
  362.         Macro
  363.         _ResetAlertStage
  364.             dc.w     $4278
  365.             dc.w     $0A9A
  366.         EndM
  367.     ELSE
  368.         IMPORT_CFM_FUNCTION    ResetAlertStage
  369.     ENDIF
  370.  
  371. ;
  372. ; pascal void DialogCut(DialogRef theDialog)
  373. ;
  374.     IF GENERATINGCFM THEN
  375.         IMPORT_CFM_FUNCTION    DialogCut
  376.     ENDIF
  377.  
  378. ;
  379. ; pascal void DialogPaste(DialogRef theDialog)
  380. ;
  381.     IF GENERATINGCFM THEN
  382.         IMPORT_CFM_FUNCTION    DialogPaste
  383.     ENDIF
  384.  
  385. ;
  386. ; pascal void DialogCopy(DialogRef theDialog)
  387. ;
  388.     IF GENERATINGCFM THEN
  389.         IMPORT_CFM_FUNCTION    DialogCopy
  390.     ENDIF
  391.  
  392. ;
  393. ; pascal void DialogDelete(DialogRef theDialog)
  394. ;
  395.     IF GENERATINGCFM THEN
  396.         IMPORT_CFM_FUNCTION    DialogDelete
  397.     ENDIF
  398.  
  399. ;
  400. ; pascal void SetDialogFont(short value)
  401. ;
  402.     IF ¬ GENERATINGCFM THEN
  403.         Macro
  404.         SetDialogFont        &src=(sp)+
  405.         move.w               &src,$0AFA
  406.         EndM
  407.     ELSE
  408.         IMPORT_CFM_FUNCTION    SetDialogFont
  409.     ENDIF
  410.  
  411. ;
  412. ; pascal void AppendDITL(DialogRef theDialog, Handle theHandle, DITLMethod method)
  413. ;
  414.     IF GENERATINGCFM THEN
  415.         IMPORT_CFM_FUNCTION    AppendDITL
  416.     ENDIF
  417.  
  418. ;
  419. ; pascal short CountDITL(DialogRef theDialog)
  420. ;
  421.     IF GENERATINGCFM THEN
  422.         IMPORT_CFM_FUNCTION    CountDITL
  423.     ENDIF
  424.  
  425. ;
  426. ; pascal void ShortenDITL(DialogRef theDialog, short numberItems)
  427. ;
  428.     IF GENERATINGCFM THEN
  429.         IMPORT_CFM_FUNCTION    ShortenDITL
  430.     ENDIF
  431.  
  432. ;
  433. ; pascal Boolean StdFilterProc(DialogRef theDialog, EventRecord *event, short *itemHit)
  434. ;
  435.     IF GENERATINGCFM THEN
  436.         IMPORT_CFM_FUNCTION    StdFilterProc
  437.     ENDIF
  438.  
  439. ;
  440. ; pascal OSErr GetStdFilterProc(ModalFilterUPP *theProc)
  441. ;
  442.     IF ¬ GENERATINGCFM THEN
  443.         Macro
  444.         _GetStdFilterProc
  445.             move.w    #$0203,d0
  446.             dc.w     $AA68
  447.         EndM
  448.     ELSE
  449.         IMPORT_CFM_FUNCTION    GetStdFilterProc
  450.     ENDIF
  451.  
  452. ;
  453. ; pascal OSErr SetDialogDefaultItem(DialogRef theDialog, short newItem)
  454. ;
  455.     IF ¬ GENERATINGCFM THEN
  456.         Macro
  457.         _SetDialogDefaultItem
  458.             move.w    #$0304,d0
  459.             dc.w     $AA68
  460.         EndM
  461.     ELSE
  462.         IMPORT_CFM_FUNCTION    SetDialogDefaultItem
  463.     ENDIF
  464.  
  465. ;
  466. ; pascal OSErr SetDialogCancelItem(DialogRef theDialog, short newItem)
  467. ;
  468.     IF ¬ GENERATINGCFM THEN
  469.         Macro
  470.         _SetDialogCancelItem
  471.             move.w    #$0305,d0
  472.             dc.w     $AA68
  473.         EndM
  474.     ELSE
  475.         IMPORT_CFM_FUNCTION    SetDialogCancelItem
  476.     ENDIF
  477.  
  478. ;
  479. ; pascal OSErr SetDialogTracksCursor(DialogRef theDialog, Boolean tracks)
  480. ;
  481.     IF ¬ GENERATINGCFM THEN
  482.         Macro
  483.         _SetDialogTracksCursor
  484.             move.w    #$0306,d0
  485.             dc.w     $AA68
  486.         EndM
  487.     ELSE
  488.         IMPORT_CFM_FUNCTION    SetDialogTracksCursor
  489.     ENDIF
  490.  
  491.     IF OLDROUTINENAMES  THEN
  492.     IF ¬ GENERATINGCFM  THEN
  493. ;
  494. ; pascal void CouldDialog(short dialogID)
  495. ;
  496.     IF ¬ GENERATINGCFM THEN
  497.         _CouldDialog:    OPWORD    $A979
  498.     ELSE
  499.         IMPORT_CFM_FUNCTION    CouldDialog
  500.     ENDIF
  501.  
  502. ;
  503. ; pascal void FreeDialog(short dialogID)
  504. ;
  505.     IF ¬ GENERATINGCFM THEN
  506.         _FreeDialog:    OPWORD    $A97A
  507.     ELSE
  508.         IMPORT_CFM_FUNCTION    FreeDialog
  509.     ENDIF
  510.  
  511. ;
  512. ; pascal void CouldAlert(short alertID)
  513. ;
  514.     IF ¬ GENERATINGCFM THEN
  515.         _CouldAlert:    OPWORD    $A989
  516.     ELSE
  517.         IMPORT_CFM_FUNCTION    CouldAlert
  518.     ENDIF
  519.  
  520. ;
  521. ; pascal void FreeAlert(short alertID)
  522. ;
  523.     IF ¬ GENERATINGCFM THEN
  524.         _FreeAlert:    OPWORD    $A98A
  525.     ELSE
  526.         IMPORT_CFM_FUNCTION    FreeAlert
  527.     ENDIF
  528.  
  529.     ENDIF
  530.     ELSE
  531.     ENDIF
  532.     ENDIF ; __DIALOGS__
  533.